<?php
class PersonModel extends CommonModel {

	       function getUserId(){
        return $_SESSION[C('USER_AUTH_KEY')];
    }

    protected $_link = array(
        'Company'=> array(
            'mapping_type'=>BELONGS_TO,             
            //'class_name'=>'Classes',             
            //外键       
            'foreign_key'=>'company_id',             
            'mapping_name'=>'company' ,             
            //关联的字段，可以多个             
            'mapping_fields'=>'company_name',             
            'as_fields'=>'company_name:companyname'            
        )    
    ); 
    
}